#include<stdio.h>
int main()
{
	 int  a=0,b=0,number=0;
	 int i=0,n=0;
	scanf("%d%d",&a,&b);
	for(i=a;i<=b;i++)
	{
		number=i;
		do
		{
			if((number%10)==8)
			{
				n++;
                                break;
			}
			number/=10;
                    
		}while(number!=0);
	}
	printf("%d",n);
	return 0;
}
